﻿@model  ShiXuLong.Model.UserModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>XianShi</title>
    <link href="~/scripts/css/layui.css" rel="stylesheet" /> 
    <script src="~/scripts/jquery-3.5.1.js"></script>
    <link href="~/scripts/layui/css/layui.css" rel="stylesheet" />
   
    
</head>
<body>
    <div> 
        <div>
            @using (Ajax.BeginForm("Edit", "User", new AjaxOptions { OnSuccess = "EditComp" }))
            {
                @Html.HiddenFor(m => m.Id)

                <div class="layui-form-item">
                    
                    @Html.LabelFor(m => m.UserName)
                    @Html.TextBoxFor(m => m.UserName)
                    @Html.ValidationMessageFor(m => m.UserName)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.UserPwd)
                    @Html.TextBoxFor(m => m.UserPwd)
                    @Html.ValidationMessageFor(m => m.UserPwd)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.UserTypeId)
                    @Html.TextBoxFor(m => m.UserTypeId)
                    @Html.ValidationMessageFor(m => m.UserTypeId)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.UserSex)
                    @Html.TextBoxFor(m => m.UserSex)
                    @Html.ValidationMessageFor(m => m.UserSex)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.UserAge)
                    @Html.TextBoxFor(m => m.UserAge)
                    @Html.ValidationMessageFor(m => m.UserAge)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.Phone)
                    @Html.TextBoxFor(m => m.Phone)
                    @Html.ValidationMessageFor(m => m.Phone)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.Email)
                    @Html.TextBoxFor(m => m.Email)
                    @Html.ValidationMessageFor(m => m.Email)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.Province)
                    @Html.TextBoxFor(m => m.Province)
                    @Html.ValidationMessageFor(m => m.Province)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.City)
                    @Html.TextBoxFor(m => m.City)
                    @Html.ValidationMessageFor(m => m.City)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.Area)
                    @Html.TextBoxFor(m => m.Area)
                    @Html.ValidationMessageFor(m => m.Area)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.AddRess)
                    @Html.TextBoxFor(m => m.AddRess)
                    @Html.ValidationMessageFor(m => m.AddRess)
                </div>
                <div class="layui-form-item">
                    @Html.LabelFor(m => m.CreateTime)
                    @Html.TextBoxFor(m => m.CreateTime)
                    @Html.ValidationMessageFor(m => m.CreateTime)
                </div>

                <div>
                    <button>提交</button>
                </div>
            }
            <script>
                function EditComp(re) {
                    if (re.success) {
                        parent.layer.msg(re.msg);
                        parent.layui.$("#btnAdd").click();
                        //当你在iframe页面关闭自身时
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    } else {
                        alert(re.msg)
                    }
                }
            </script>
        </div>
    </div>
</body>
</html>
